refactor: explicit lockfile priority, derived PM type, changelog#2
Merged
Conversation
Replaces the LOCKFILES object (priority encoded implicitly via JS key order) with an ordered tuple array, and collapses the package-manager union + runtime set into a single const source of truth with a type guard, removing a cast. Behavior-preserving — all 13 tests still pass. Adds CHANGELOG.md documenting the 0.1.3 release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Follow-up polish from a whole-codebase review. Two small internal cleanups that make the detection code read more directly, plus a CHANGELOG. No behavior change — the 13 existing tests cover detection, Corepack, priority, and the npm arg transform, and all still pass.
Summary
LOCKFILESis now an ordered tuple array, not an object. Detection priority was correct before (JS preserves string-key order) but encoded implicitly; the array makes "order = priority" explicit and self-documenting.PackageManagerunion and the runtimeSetwere duplicated; now there's oneconst PACKAGE_MANAGERStuple, the type is derived from it, and anisPackageManagertype guard replaces aname as PackageManagercast.CHANGELOG.mddocumenting the0.1.3release (the fixes shipped in PR fix: correct package-manager detection and harden the CLI #1).Test Plan
bun run typecheck— cleanbun run lint— cleanbun run test— 13/13 passbun run build— succeedssrc/still resolves bun via the root lockfile